xenstore: add explicit memory context parameter to get_node()
authorJuergen Gross <jgross@suse.com>
Tue, 19 Jul 2016 11:30:45 +0000 (13:30 +0200)
committerWei Liu <wei.liu2@citrix.com>
Tue, 19 Jul 2016 11:56:59 +0000 (12:56 +0100)
commitab32687503e054a72ebcede9b7aa34ef856634f6
treecf43ff61502f2841a57fc3f2f5d42a5aa1231b98
parentba81f6636f76511cae83425b1a2e4ade202810fb
xenstore: add explicit memory context parameter to get_node()

Add a parameter to xenstored get_node() function to explicitly
specify the memory context to be used for allocations. This will make
it easier to avoid memory leaks by using a context which is freed
soon.

This requires adding the temporary context to errno_from_parents() and
ask_parents(), too.

When calling get_node() select a sensible memory context for the new
parameter by preferring a temporary one.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/xenstore/xenstored_core.c
tools/xenstore/xenstored_core.h
tools/xenstore/xenstored_watch.c